package com.kzw.test.service;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.kzw.test.model.User;

@Service
@Transactional
public class UserService {

	@Autowired
	private JdbcTemplate template;
	
	public void save(User user) {
		String sql = "insert into tb_user3(name, age) values(?,?)";
		template.update(sql, user.getName(), user.getAge());
	}
}
